home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / win / afxvbx.zip / README.TXT < prev    next >
Text File  |  1993-06-10  |  2KB  |  33 lines

  1. This sample application shows you how to display a vbx control in a 
  2. dialog box that is a resource of an AFXDLL.  The dialog template contains
  3. a list of the controls for the dialog box.  One of the items in this list
  4. is the class name for the control.  Since VBX controls are not standard 
  5. Windows controls they do not have a class name.  MFC works around this by
  6. providing a Windows class, VBControl, which it can use to create VBX
  7. controls.  The VBControl class is used as the class name in the dialog
  8. template for every VBX control used in the dialog.
  9.  
  10. When the application that calls the DLL calls the EnableVBX()
  11. function, it registers the VBControl window class with Microsoft
  12. Windows. The VBControl class is registered as a local window class,
  13. not as a global window class. A local window class is available only
  14. to the module in which the class is registered. Because a DLL has its 
  15. own module that is different from the calling application, the VBControl 
  16. class is not available to the DLL.
  17.  
  18. Workarounds:
  19.  
  20. [1] The application can call the Create() member function of the CVBControl 
  21.     class to create the VBX control.  Call Create() in the OnInitDialog() 
  22.     function (for a modal dialog box) or in the OnCreate() function (for 
  23.     a modeless dialog box).    
  24.  
  25. [2] Re-register the VBControl class in the DLL so that it can be used from
  26.     the DLL.  Also, change the resorce instance handle during the 
  27.     OnInitDialog() function so that resource in the DLL will be used while
  28.     the controls are being created.
  29.  
  30. This second method is demontrated in the sample.
  31.  
  32.  
  33.